/*
 * config.h
 *
 *  Created on: 12.04.2014
 *      Author: Ralph
 */

#ifndef CONFIG_H_
#define CONFIG_H_

#include <QHash>
#include <QString>
#include <QVariant>

class Config
{
private:
    // Private Constructor
    Config();
    // Stop the compiler generating methods of copy the object
    Config( Config const& copy );            // Not Implemented
    Config& operator= ( Config const& copy ); // Not Implemented

    bool loadFromFile();

    QHash<QString, QVariant>m_settings;

public:
    ~Config();

    static Config& getInstance()
    {
        // The only instance
        // Guaranteed to be lazy initialized
        // Guaranteed that it will be destroyed correctly
        static Config instance;
        return instance;
    }

    bool init();
    QVariant get( QString );

};

#endif /* CONFIG_H_ */
